package com.violet.user.server.user.controller;

import com.violet.common.entity.User;
import com.violet.common.page.PageParam;
import com.violet.common.page.PageResult;
import com.violet.common.response.Result;
import com.violet.user.server.user.condition.UserCondition;
import com.violet.user.server.user.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: wqf
 * @Date: 2023/06/13
 * @Description:
 */
@Tag(name = "用户信息模块", description = "/user")
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @Operation(summary = "获取用户信息列表")
    @GetMapping("/list")
    public Result<PageResult<User>> listUser(UserCondition userCondition, PageParam pageParam) {
        PageResult<User> users = userService.listUser(userCondition, pageParam);
        return Result.succeed(users);
    }
}
